﻿using SqlSugar;
using System;

namespace banyuetan_2_0.Model.Models
{
    /// <summary>
    /// 多级分类表
    /// </summary>
    public class Category
    {
        [SugarColumn(IsNullable = false, IsPrimaryKey = true)]
        public int cID { get; set; }

        [SugarColumn(ColumnDataType ="nvarchar",Length =50,IsNullable =false)]
        public string cName { get; set; }

        [SugarColumn(ColumnDataType ="nvarchar",Length =100,IsNullable =true)]
        public string cDescribe { get; set; }

        [SugarColumn(IsNullable =true)]
        public int cCreateId { get; set; }

        [Navigat(NavigatType.ManyToOne, nameof(cCreateId))]
        public sysUserInfo sysUserInfo { get; set; }


        [SugarColumn(IsIgnore = true)]
        public string CreateUserName { get; set; }

        [SugarColumn(IsNullable = true)]
        public DateTime cUpdateTime { get; set; } = DateTime.Now;

        [SugarColumn(IsNullable =false)]
        public bool cIsDeleted { get; set; } = false;


        public int cParentId { get; set; } = 0;

        //[SugarColumn(IsIgnore =true)]
        [Navigat(NavigatType.OneToOne, nameof(cParentId))]
        public Category ParentCategory { get; set; }


    }
}
